package top.tenebrous.termbor.rpc.proxy.factory;

import top.tenebrous.termbor.rpc.proxy.config.ProxyConfig;
import top.tenebrous.termbor.rpc.proxy.object.ObjectProxy;
import top.tenebrous.termbor.rpc.spi.SPIClass;

/**
 * @program: termbor-rpc
 * @description:
 * @author: yazhang6
 * @create: 2024-05-23 08:47
 **/
public abstract class BaseProxyFactory<T> implements ProxyFactory<T> {

    protected ObjectProxy<T> objectProxy;

    @Override
    public void init(ProxyConfig<T> proxyConfig) {
        this.objectProxy =
            new ObjectProxy<>(proxyConfig.getClazz(),
                proxyConfig.getServiceVersion(),
                proxyConfig.getServiceGroup(),
                proxyConfig.getTimeout(),
                proxyConfig.getRegistryService(),
                proxyConfig.getConsumer(),
                proxyConfig.getSerializationType(),
                proxyConfig.isAsync(),
                proxyConfig.isOneway());
    }
}
